// pages/shop/juanlist/juanlist.js
import tips from '../../../class/Utils/Tips'
Page({

  /**
   * 页面的初始数据
   */
  data: {
    juanlist: [
      { id: '1', zhekou: '8', xianling: '1', shiyong: '指定商品可用，无使用门槛', zhuangtai: '0', },
      { id: '2', zhekou: '2', xianling: '1', shiyong: '指定商品可用，无使用门槛', zhuangtai: '1', },
    ],
  },
  onLoad: function (options) {

  },//领取优惠券
  lingjuan: function (e) {
    var that = this
    var thisindex = e.currentTarget.dataset.index
    console.log(thisindex)
    var datalist = that.data.juanlist
    for (var i = 0; i < datalist.length; i++) {
      datalist[i].zhuangtai = 1
    }
    that.setData({
      juanlist: datalist
    })
  },
  //去使用优惠券
  gotoused:function(){
    var that = this
    tips.godaohang('/pages/shop/index/index')
  },
})